Skip to content

feat: Refactor of Map.js and Toggles#243

Merged
regeter merged 1 commit intogooglemaps:mainfrom
regeter:main
Jul 22, 2025
Merged

feat: Refactor of Map.js and Toggles#243
regeter merged 1 commit intogooglemaps:mainfrom
regeter:main

Conversation

@regeter
Copy link
Copy Markdown
Contributor

@regeter regeter commented Jul 22, 2025

Architectural Improvements

  • Eliminated Global State: The map is now a fully self-contained React component. State is managed predictably within the component's lifecycle using hooks (useState, useRef), removing all module-level global variables.
  • Centralized Logic & Reliability: All map operations, including initialization and drawing, are now handled reliably within useEffect hooks. Expensive calculations are memoized with useMemo for improved performance.
  • Improved Maintainability: The new architecture is more robust, easier to debug, and simpler to extend.

Code Organization
All map toggle logic, including UI configuration and rendering handlers, has been consolidated into a new src/MapToggles.js module. This makes App.js and Map.js cleaner and establishes a single source for this feature.

@regeter regeter requested a review from bshi July 22, 2025 04:18
@regeter regeter merged commit bc2c9ae into googlemaps:main Jul 22, 2025
10 checks passed
googlemaps-bot pushed a commit that referenced this pull request Jul 22, 2025
## [1.19.0](v1.18.0...v1.19.0) (2025-07-22)

### Features

* Refactor of Map.js and Toggles ([#243](#243)) ([bc2c9ae](bc2c9ae))

### Build System

* **deps:** bump form-data ([#244](#244)) ([4c80f49](4c80f49))
@googlemaps-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants